//RayCastFromMouse(xf,yf,zf,xt,yt,zt,xup,yup,zup,angle,aspect, xscreen, yscreen);
var mm,dX,dY,dZ,uX,uY,uZ,vX,vY,vZ,xscreen,yscreen,x3d,y3d,z3d;
dX = argument3-argument0;
dY = argument4-argument1;
dZ = argument5-argument2;
mm = sqrt(dX*dX+dY*dY+dZ*dZ);
dX /= mm;
dY /= mm;
dZ /= mm;
uX = argument6;
uY = argument7;
uZ = argument8;
mm = uX*dX+uY*dY+uZ*dZ;
uX -= mm*dX;
uY -= mm*dY;
uZ -= mm*dZ;
mm = sqrt(uX*uX+uY*uY+uZ*uZ);
uX /= mm;
uY /= mm;
uZ /= mm;
tFOV = tan(argument9*pi/360);
uX *= tFOV;
uY *= tFOV;
uZ *= tFOV;
vX = uY*dZ-dY*uZ;
vY = uZ*dX-dZ*uX;
vZ = uX*dY-dX*uY;
vX *= argument10;
vY *= argument10;
vZ *= argument10;

xscreen = 2     * argument11 / window_get_width()  - 1;
yscreen = 1 - 2 * argument12 / window_get_height();
    
x3d = dX + uX * yscreen + vX * xscreen;
y3d = dY + uY * yscreen + vY * xscreen;
z3d = dZ + uZ * yscreen + vZ * xscreen;
    
if(argument2 >0){
    global.xmouse=argument0+(x3d*(-argument2/z3d));
    global.ymouse=argument1+(y3d*(-argument2/z3d));
    return true;
}
else{
    return false;
}
 
